home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 43.zip
/
Lattice Compiler disk 1.adf
/
execute.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-09-18
|
1KB
|
69 lines
#include "stdio.h"
#include "fcntl.h"
#include "exec/types.h"
#include "exec/nodes.h"
#include "exec/lists.h"
#include "exec/libraries.h"
#include "exec/ports.h"
#include "exec/interrupts.h"
#include "exec/io.h"
#include "exec/memory.h"
#include "libraries/dos.h"
#include "libraries/dosextens.h"
#define BUFF_SIZE 1
extern struct FileHandle *Open();
main()
{
char string[255];
int a;
while (5<6){
a=getstring(string);
printf("%s",string);
execute(string);
}
}
getstring(string)
char *string;
{
int count,file,lengte,status;
char *buffer,letter[1];
count = 0;
lengte = 1;
status = 0;
buffer = letter;
file = open("ser:",O_RDONLY);
if (file != -1){
status = read(file,buffer,lengte);
while (*buffer != '\n'){
string[count] = *buffer;
status = read(file,buffer,lengte);
count ++;
}
string[count] = '\0';
count = 0;
status = close(file);
return(status);
}
return(file);
}
execute(string)
char *string;
{
struct FileHandle *serial;
int Success;
serial=Open("SER:",MODE_OLDFILE);
Success=Execute(string,0,serial);
Close(serial);
return(Success);
}